import Vue from 'vue'
import App from './App.vue'
import router from './router/index.js'
import store from './store/index.js'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import cwbUI from 'cwb-ui'
import 'cwb-ui/lib/cwb-ui.css'
import api from './common/api.js'
import com from './common/common.js'
require('./mock/index.js')
// import 'lib-flexible/flexible.js'
console.log(process.env)

Vue.use(ElementUI)
Vue.use(cwbUI)

Vue.config.productionTip = false
Vue.prototype.$api = api
Vue.prototype.$com = com

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

//rem适配
function setRem() {
  var bodyWidth = document.body.clientWidth;// 当前窗口的宽度
  var rem = 100 * bodyWidth / 1920;   // bodywidth/1920*100  以默认比例值乘以当前窗口宽度,得到该宽度下的相应FONT-SIZE值
  document.getElementsByTagName('html')[0].style.fontSize = rem + 'px';
}
window.addEventListener('load', setRem);
window.addEventListener('resize', setRem);
